package com.cadre.system.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cadre.common.utils.annotation.A01Tag;
import com.cadre.common.utils.oldutil.PageUtils;
import com.cadre.common.utils.oldutil.Query;
import com.cadre.system.domain.officer.A01;
import com.cadre.system.mapper.*;
import com.cadre.system.service.A01Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ClassUtils;

import javax.imageio.stream.FileImageInputStream;
import java.io.*;
import java.net.URLDecoder;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service("a01Service")
/* loaded from: A01ServiceImpl.class */
public class A01ServiceImpl extends ServiceImpl<A01Mapper, A01> implements A01Service {
    @Autowired
    private A01Mapper a01Mapper;
    @Autowired
    private A79Mapper a79Mapper;
    @Autowired
    private A19Mapper a19Mapper;
    @Autowired
    private A04Mapper a04Mapper;
    @Autowired
    private A16Mapper a16Mapper;
    @Autowired
    private A26Mapper a26Mapper;
    @Autowired
    private A17Mapper a17Mapper;
    @Autowired
    private A92Mapper a92Mapper;
    @Autowired
    private A91Mapper a91Mapper;
    @Autowired
    private A22Mapper a22Mapper;
    @Autowired
    private InverseQueryMapper inverseQueryMapper;

    /*  JADX ERROR: JadxRuntimeException in pass: BlockProcessor
        jadx.core.utils.exceptions.JadxRuntimeException: Unreachable block: B:4:0x0055
        	at jadx.core.dex.visitors.blocks.BlockProcessor.checkForUnreachableBlocks(BlockProcessor.java:86)
        	at jadx.core.dex.visitors.blocks.BlockProcessor.processBlocksTree(BlockProcessor.java:52)
        	at jadx.core.dex.visitors.blocks.BlockProcessor.visit(BlockProcessor.java:44)
        */
    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    @A01Tag("更新")
    @Transactional(rollbackFor = {Exception.class})
    public int insertSelective(A01 r6) {
        try{
            String basePath = ClassUtils.getDefaultClassLoader().getResource("")
                    .getPath()+"pic";
            String imagePath = basePath +"/nan_pic.jpg";
            try {
                imagePath = URLDecoder.decode(imagePath, "UTF-8");
                System.out.println("default image path:" + imagePath);
            }catch(UnsupportedEncodingException e){
                    e.printStackTrace();
            }
            System.out.println("default img path"+basePath);
            if(r6.getA0171() == null || (r6.getA0171()).length==0){
                if(!r6.getA0105().equals("男") && r6.getA0105().equals("女")){
                    imagePath = basePath+"/nv_pic.jpg";
                    imagePath = URLDecoder.decode(imagePath, "UTF-8");
                }
                r6.setA0171(image2byte(imagePath));
            }
        } catch (Exception e) {}
        return this.a01Mapper.insertSelective(r6);
    }

    public byte[] image2byte(String path) {
        byte[] data = null;
        try {
            FileImageInputStream input = new FileImageInputStream(new File(path));
            ByteArrayOutputStream output = new ByteArrayOutputStream();
            byte[] buf = new byte[1024];
            while (true) {
                int numBytesRead = input.read(buf);
                if (numBytesRead == -1) {
                    break;
                }
                output.write(buf, 0, numBytesRead);
            }
            data = output.toByteArray();
            output.close();
            input.close();
        } catch (FileNotFoundException ex1) {
            ex1.printStackTrace();
        } catch (IOException ex12) {
            ex12.printStackTrace();
        }
        return data;
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    @Transactional
    public int updateByPrimaryKeySelective(A01 record) {
        return this.a01Mapper.updateByPrimaryKeySelective(record);
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    @A01Tag("更新")
    @Transactional(rollbackFor = {Exception.class})
    public int updateXianz(A01 record) {
        return this.a01Mapper.updateByPrimaryKeySelective(record);
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    @Transactional(rollbackFor = {Exception.class})
    public int deleteByPrimaryKey(String flowid) {
        return this.a01Mapper.deleteByPrimaryKey(flowid);
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    public List<A01> selectList(Map<String, Object> map) {
        return this.a01Mapper.selectList(map);
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    @Transactional(rollbackFor = {Exception.class})
    public int updateResumeByPrimaryKey(A01 a01) {
        return this.a01Mapper.updateResumeByPrimaryKey(a01);
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    @Transactional(rollbackFor = {Exception.class})
    public int updateA0171(String a0171string, String flowid) {
        return this.a01Mapper.updateA0171(a0171string, flowid);
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    public List<Map<String, Object>> selectA0177List() {
        return this.a01Mapper.selectA0177List();
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    public int checkA01Repeat(A01 a01) {
        return this.a01Mapper.checkA01Repeat(a01);
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    public A01 selectByPrimaryKey(String flowid) {
        return this.a01Mapper.selectByPrimaryKey(flowid);
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    public PageUtils inverseQueryZhiji(Map<String, Object> map) {
        map.put("page", (String) map.get("pageNum"));
        map.put("limit", (String) map.get("pageSize"));
        try {
            if (map.get("unitCode") != null) {
                List<String> uList = Arrays.asList(map.get("unitCode").toString().split(","));
                map.remove("unitCode");
                map.put("uList", uList);
            }
        } catch (Exception e) {
        }
        Page<A01> page = new Query(map).getPage();
        return new PageUtils(page.setRecords(this.inverseQueryMapper.inverseQueryZhiji(page, map)));
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    public PageUtils inverseQueryCheckUp(Map<String, Object> map) {
        map.put("page", (String) map.get("pageNum"));
        map.put("limit", (String) map.get("pageSize"));
        Page<A01> page = new Query(map).getPage();
        return new PageUtils(page.setRecords(this.a01Mapper.inverseQueryCheckUp(page, map)));
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    public PageUtils inverseQueryCheckUp1(Map<String, Object> map) {
        map.put("page", (String) map.get("pageNum"));
        map.put("limit", (String) map.get("pageSize"));
        Page<A01> page = new Query(map).getPage();
        return new PageUtils(page.setRecords(this.a01Mapper.inverseQueryCheckUp1(page, map)));
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    public PageUtils inverseQueryCheckUp2(Map<String, Object> map) {
        map.put("page", (String) map.get("pageNum"));
        map.put("limit", (String) map.get("pageSize"));
        Page<A01> page = new Query(map).getPage();
        return new PageUtils(page.setRecords(this.a01Mapper.inverseQueryCheckUp2(page, map)));
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    public PageUtils inverseQueryCheckUp3(Map<String, Object> map) {
        map.put("page", (String) map.get("pageNum"));
        map.put("limit", (String) map.get("pageSize"));
        Page<A01> page = new Query(map).getPage();
        return new PageUtils(page.setRecords(this.a01Mapper.inverseQueryCheckUp3(page, map)));
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    public PageUtils inverseQueryRetire(Map<String, Object> map) {
        map.put("page", (String) map.get("pageNum"));
        map.put("limit", (String) map.get("pageSize"));
        Page<A01> page = new Query(map).getPage();
        return new PageUtils(page.setRecords(this.a01Mapper.inverseQueryRetire(page, map)));
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    public PageUtils inverseQueryWorkInAdvance(Map<String, Object> map) {
        map.put("page", (String) map.get("pageNum"));
        map.put("limit", (String) map.get("pageSize"));
        Page<A01> page = new Query(map).getPage();
        return new PageUtils(page.setRecords(this.a01Mapper.inverseQueryWorkInAdvance(page, map)));
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    public List<A01> inverseQueryWorkInAdvanceb(Map<String, Object> map) {
        return this.a01Mapper.inverseQueryWorkInAdvance(map);
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    public PageUtils inverseQueryAheadJoinparty(Map<String, Object> map) {
        map.put("page", (String) map.get("pageNum"));
        map.put("limit", (String) map.get("pageSize"));
        Page<A01> page = new Query(map).getPage();
        return new PageUtils(page.setRecords(this.a01Mapper.inverseQueryAheadJoinparty(page, map)));
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    public PageUtils inverseQueryInthetime(Map<String, Object> map) {
        map.put("page", (String) map.get("pageNum"));
        map.put("limit", (String) map.get("pageSize"));
        Page<A01> page = new Query(map).getPage();
        return new PageUtils(page.setRecords(this.a01Mapper.inverseQueryInthetime(page, map)));
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    public PageUtils inverseQueryEducation(Map<String, Object> map) {
        map.put("page", (String) map.get("pageNum"));
        map.put("limit", (String) map.get("pageSize"));
        Page<A01> page = new Query(map).getPage();
        return new PageUtils(page.setRecords(this.inverseQueryMapper.inverseQueryEducation(page, map)));
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    @Transactional(rollbackFor = {Exception.class})
    public void deleteDetails(List<String> tList, List<String> idList) {
        for (String t : tList) {
            this.a01Mapper.deleteDetails(t, idList);
        }
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    @Transactional(rollbackFor = {Exception.class})
    public int updateBys(A01 record) {
        return this.a01Mapper.updateBys(record);
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    public List<A01> inverseQueryZhijib(Map<String, Object> map) {
        return this.inverseQueryMapper.inverseQueryZhiji(map);
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    public List<A01> inverseQueryEducationb(Map<String, Object> map) {
        return this.inverseQueryMapper.inverseQueryEducation(map);
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    public List<A01> inverseQueryCheckUpb(Map<String, Object> map) {
        return this.a01Mapper.inverseQueryCheckUp(map);
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    public List<A01> inverseQueryRetireb(Map<String, Object> map) {
        return this.a01Mapper.inverseQueryRetire(map);
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    public List<A01> inverseQueryAheadJoinpartyb(Map<String, Object> map) {
        return this.a01Mapper.inverseQueryAheadJoinparty(map);
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    public List<A01> inverseQueryInthetimeb(Map<String, Object> map) {
        return this.a01Mapper.inverseQueryInthetime(map);
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    public List<A01> inverseQueryCheckUp1b(Map<String, Object> map) {
        return this.a01Mapper.inverseQueryCheckUp1(map);
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    public List<A01> inverseQueryCheckUp2b(Map<String, Object> map) {
        return this.a01Mapper.inverseQueryCheckUp2(map);
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    public List<A01> inverseQueryCheckUp3b(Map<String, Object> map) {
        return this.a01Mapper.inverseQueryCheckUp3(map);
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    public List<A01> inverseQueryQiye(Map<String, Object> map) {
        return this.inverseQueryMapper.inverseQueryQiye(map);
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    public String queryUnitId(String flowid) {
        return this.a01Mapper.queryUnitId(flowid);
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    public List<String> queryHasUnitIds(Long userId) {
        return this.a01Mapper.queryHasUnitIds(userId);
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    public List<A01> inverseQueryRetireByConfig(Map<String, Object> map) {
        return this.a01Mapper.inverseQueryRetireByConfig(map);
    }
    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    public List<A01> inverseQueryRetireByConfigByList(Map<String, Object> map) {
        return this.a01Mapper.inverseQueryRetireByConfig(map);
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    public List<A01> inverseQueryWorkInAdvancebConfig(Map<String, Object> map) {
        return this.a01Mapper.inverseQueryWorkInAdvanceConfig(map);
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    public List<A01> inverseQueryAheadJoinpartyConfig(Map<String, Object> map) {
        return this.a01Mapper.inverseQueryAheadJoinpartyConfig(map);
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    public List<A01> inverseQueryPositionLevelByConfig(Map<String, Object> map) {
        return this.a01Mapper.inverseQueryPositionLevelByConfig(map);
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    public List<A01> inverseQueryRankByConfig(Map<String, Object> map) {
        return this.a01Mapper.inverseQueryRankByConfig(map);
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    public List<A01> inverseQueryRewardByConfig(Map<String, Object> map) {
        return this.a01Mapper.inverseQueryRewardByConfig(map);
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    public List<A01> inverseQueryPunishmentByConfig(Map<String, Object> map) {
        return this.a01Mapper.inverseQueryPunishmentByConfig(map);
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    public List<A01> inverseQueryCheckUp2_1(Map<String, Object> map) {
        return this.a01Mapper.inverseQueryCheckUp2_1(map);
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    public List<A01> inverseQueryCheckUp2_2(Map<String, Object> map) {
        return this.a01Mapper.inverseQueryCheckUp2_2(map);
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    public List<A01> inverseQueryCheckUp2_3(Map<String, Object> map) {
        return this.a01Mapper.inverseQueryCheckUp2_3(map);
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    public List<A01> inverseQueryCheckUp2_4(Map<String, Object> map) {
        return this.a01Mapper.inverseQueryCheckUp2_4(map);
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    public List<A01> getSamePerson(Map<String, Object> map) {
        return this.a01Mapper.getSamePerson(map);
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    public int deleteData(String tableName) {
        return this.a01Mapper.deleteData(tableName);
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    public int updateA0180ByPrescode(A01 a01) {
        return this.a01Mapper.updateA0180ByPrescode(a01);
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    public int updateA0181ByPrescode(A01 a01) {
        return this.a01Mapper.updateA0181ByPrescode(a01);
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    public int setPersonPhoto(A01 a01) {
        return this.a01Mapper.setPersonPhoto(a01);
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    public int updateTableColumnWidth(String sql) {
        return this.a01Mapper.updateTableColumnWidth(sql);
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    public List<A01> inverseQueryCheckUp63(Map<String, Object> map) {
        return this.a01Mapper.inverseQueryCheckUp63(map);
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    public List<A01> inverseQueryPunish(Map<String, Object> map) {
        return this.a01Mapper.inverseQueryPunish(map);
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    public List<A01> inverseQueryCurrentYear(String paramValue) {
        return this.a01Mapper.inverseQueryCurrentYear(paramValue);
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    public List<A01> inverseProbation() {
        return this.a01Mapper.inverseProbation();
    }

    @Override // com.tdqy.cadre.modular.profess.service.A01Service
    public List<A01> selectEs() {
        List<A01> a01s = this.a01Mapper.selectList(new HashMap());
        for (A01 a01 : a01s) {
            String flowid = a01.getFlowid();
            Map<String, Object> map = new HashMap<>();
            map.put("personid", flowid);
            a01.setA79List(this.a79Mapper.selectByPersonid(flowid));
            a01.setA19List(this.a19Mapper.selectByPersonid(flowid));
            a01.setA04List(this.a04Mapper.selectByPersonid(map));
            a01.setA16List(this.a16Mapper.selectByList(map));
            a01.setA22List(this.a22Mapper.selectListByPersonId(flowid));
            a01.setA26List(this.a26Mapper.selectByList(map));
            a01.setA17List(this.a17Mapper.selectByPersonId(flowid));
            a01.setA92List(this.a92Mapper.selectByMap(map));
            a01.setA91List(this.a91Mapper.selectByMap(map));
        }
        return a01s;
    }
}
